package entidades;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.UniqueConstraint;

import enums.Situacao;

@Entity
@Table(uniqueConstraints={@UniqueConstraint(columnNames={"id_medico", "id_horario", "dtExame"})})
public class Exame implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	public long id;
	
	@ManyToOne
	@JoinColumn(name="id_paciente", referencedColumnName="id")
	public Paciente paciente;
	
	@ManyToOne
	@JoinColumn(name="id_medico", referencedColumnName="id")
	public Medico medico;
	
	@ManyToOne
	@JoinColumn(name="id_tpExame", referencedColumnName="id")
	public TipoExame tpExame;
	
	@ManyToOne
	@JoinColumn(name="id_horario", referencedColumnName="id")
	public Horario horario;
	
	@Enumerated(EnumType.STRING)
	public Situacao situacao;
	
	public double precoFinal = 0.0;
	
	public String laudoFinal;
	
	@Temporal(TemporalType.DATE)
	public Date dtExame;
	
	

}
